<%@ page language="java" session="true" errorPage="ElderhealthError.jsp"%>
<%
/*
 * Source:   ElderhealthWorkerSearch.jsp
 * Purpose:  This page will take in a worker's name and call a page to go find that worker.
 */
%>

<html>
<head>
<link rel="stylesheet" type="text/css" href="elderhealth.css">
<!-- Scripting Portion -->
<script type="text/javascript" src="elderhealth.js"></script>
</head>
<body>

<%@ include file="ElderhealthHeader.jsp" %>

<form name="workerSearch" action="DoWorkerSearch.jsp" method="get">
<table border=0 align="left" border=0 cellpadding=0 cellspacing=0 width="600">
    <tr class="contactHeaderText"><td height="18" align="left" valign="middle" style="PADDING-LEFT:10px">Worker Search</td></tr>
    <tr><td class="layoutLine" valign="middle" align="left" width="302" height="1" colSpan="4"></td></tr>
    <tr class="contactBar1"><td align="left" valign="middle" style="PADDING-LEFT:10px">
            You can either enter first charater or full name in the First Name box for specific name search 
            or you can enter any character in the Last Name box for the whole list.
            <br>
            The wildcard character (%) may be used for Name (e.g. R%)
            <br>
		First name: <input type="text" name="firstname">
		<br>
		Last name: <input type="text" name="lastname">
    	      <br>
		<input type="button" value="Search" onClick="validatePage()">
		<input type="button" value="Cancel" onClick="history.back();"><br><br>
    </td></tr>
    <tr><td class="layoutLine" valign="middle" align="left" width="302" height="1" colSpan="4"></td></tr>
</table>
</form>

</body>
</html>
<script language="javascript">

function validatePage() 
{
  if (document.workerSearch.firstname.value.length==0 && 
        document.workerSearch.lastname.value.length==0)
  {
    alert("No search criteria was submitted. Please search on at least one criteria.");
  }
  else
  {
    document.workerSearch.submit();
  }
}

</script>
